#include <stdio.h>
#include <math.h>
#include "cpu.h"


//recieves random interrupts from io device threads

//a io request will activate the corresponding io module   (maybe a thread_signal)


/*
*   run a single step, the simulator handles the loop
*   return a packet containing the information the gui needs to update properly.
*   The packet will need to be freed from memory by the caller of this function.
*/
PacketPtr cpuStep() {
    /*packet needs to accomplish the following
        The simulation will print a string of text messages indicating
        which process is running, when it generates a service request,
        when an interrupt occurs, when a context switch occurs, and the
        state of each process on each context switch.
    */

    //call step on the current process & recieves a requesttype from the call

    //run handleRequest on the variable,   handleRequest(variable);

    //assemble a packet & return it
}

void handleRequest(int request) { //if a queue is being updated we need to make it an atomic action
    switch(request) {                   //so an interrupt doesn't change the queues before hand
        case NOTHING:  break;
        case IO:       break;
        case SYNC:     break;
        default:   break;
    }

}
